<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
   pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="support.*,java.util.*"%>
<html>
<head>
<link rel="stylesheet" type="text/css" href="layout.css" />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Degree Discipline</title>
</head>
<body>
<%
   student applicant = (student) session.getAttribute("applicant");
   //add a new degree to the map with the counter
   int count = (Integer) session.getAttribute("count");
   int marker;
   //check for custom university

   if (request.getParameter("university") == null) {
      String custUniv = (String) request.getParameter("custUniversity");
      Vector universities = (Vector) applicant.getUniversityVector();
      Vector tuple = (Vector) universities.get(applicant.degreeMap.get(
            count).getDegLocation());
      Vector universitiesOnly = (Vector) tuple.get(1);
      universitiesOnly.add(custUniv);
      //marker is number in the universities only list that has been
      //selected
      marker = universitiesOnly.size() - 1;
   } else {
      marker = Integer.parseInt((String) request
            .getParameter("university"));

   }

   //add it to the degree
   applicant.degreeMap.get(count).setDegreeUniversity(marker);

   support s = new support();
%>

   <h1>Degrees - Discipline</h1>
   <hr>
   <p>Please Choose your discipline from the list below:</p>

   <form method="POST" action="degreeMore.jsp">
      <%
         for (int i = 0; i < applicant.getMajors().size(); i++) {
      %>
      <input type="radio" name="discipline" value="<%=i%>" />
      <%=applicant.getMajors().get(i)%><br />
      <%
         }
      %>
      <p>Or, enter your own discipline: <input type="text" name="custMajor" /></p><br />
      <label for="month" class="left">Month Received: </label><input type="text" name="month" />(MM)<br /><br />
      <label for="year" class="left">Year Received: </label><input type="text" name="year" />(YYYY)<br /><br />
      <label for="GPA" class="left">GPA: </label><input type="text" name="GPA" /><br /><br />
      <label for="title" class="left">Title: </label><select name="title">
         <option value="BS">BS</option>
         <option value="MS">MS</option>
         <option value="PhD">PhD</option>
      </select><br /><br />
      <input type="submit" value="Submit" />
   </form>
</body>
</html>